'''
干一些耗时操作的
进程》线程》协程（生成器）

greenlet <gevent(自动切换耗时的操作)
'''
import gevent
import time
from gevent import monkey
monkey.patch_all()
def a():
    for i in range(5):
        print("A"+str(i))
        time.sleep(0.2)
def b():
    for i in range(5):
        print("B"+str(i))
        time.sleep(0.2)
def c():
    for i in range(5):
        print("C"+str(i))
        time.sleep(0.2)
if __name__ == '__main__':
    ga = gevent.spawn(a)
    gb = gevent.spawn(b)
    gc = gevent.spawn(c)
    ga.join()
    gb.join()
    gc.join()
